<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>原型链</title>
</head>

<body>
  <script>
    // ============================== 原型链 ==============================
    // __proto__属性链状结构称为原型链
    function Person(name , age) {
      this.name = name
      this.age = age
    }
    Person.prototype.name = 'lw'
    Object.prototype.gender = '男'
    let p = new Person()
    console.log(p.name)
    console.log(p.age)
    console.log(p.gender)
    console.log(p.sex)
  </script>
</body>

</html>